Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Solana implementation #15

Open
wants to merge 50 commits into
base: main
Choose a base branch
from

Conversation

a5-pickle
Copy link

  • Adds Solana swap layer integrating with Jupiter V6
  • Adds e2e test demonstrating interaction between EVM and Solana implementations
  • Adds CI for pull requests

barnjamin and others added 30 commits August 12, 2024 12:26
* solana: init

* solana: fix solana version

* solana: add anchor-spl

* solana: setup SwapLayer testing and initialize

* add .gitmodules

* solana: more setup

* solana: fix Makefile

* solana: remove copied ts files and add common dependency

* solana: add swap message serde

* solana: add swap-layer-messages; fix Anchor.toml

* solana: split uniswap and trader joe

* solana: update submodule

* solana: add gas dropoff scaffolding (WIP)

* solana: add sdk v2 beta packages

* universal: add messages

* solana: fix broken test; fix format

* universal: fmt

* solana: handle self redeem relay type for USDC

* solana: account fetcher WIP

* solana: more test validator set up

* solana: add gas dropoff test

* solana: add direct redeem mode instruction for USDC

* solana: add peer registration and check in redeem instructions

* solana: add relay parameters to peer registration

* solana: test whirlpool via jupiter

* update sdk version, set tsconfig to use nodenext resolution

Set module to esnext and resolution to bundler

* solana: decodeSharedAccountsRouteIxData

* return deserialized data

* solana: jup v6 cpi WIP

* solana: use preparedFill key as seed in complete token account

* solana: fix .gitignore

* solana: reorganize; skip swap test

* solana: update relay parameters

* solana: fork mainnet

* solana: add relayer fee calculations

* universal: add anchor feature

* universal: remove default

* solana: add outbound usdc instruction (untested)

* solana: uptick submodule

* universal/rs: uptick deps

* universal/rs: remove default

* solana: uptick to anchor 0.30.0

* solana: add outbound usdc happy path tests

* solana: remove test

* add CI (#4)

* submodule: test commit

* fix Makefiles

* solana: fix lint

* add workflow

* more workflow

* fix Makefiles again

* fix workflow

* solana: fix Makefile

* universal: fix clippy

* sync submodule

---------

Co-authored-by: A5 Pickle <[email protected]>

* SDK: Minimal changes to make ts build (#5)

* minimal changes to get ts to build

* set noEmit to true for anchor tests

* set core bridge pid to mainnet

* provide path to workspace package.json

* submodule?

* solana: add ability to skip module build (#7)

Co-authored-by: A5 Pickle <[email protected]>

* solana: add admin instructions (#6)

* solana: add admin instructions

* solana: add admin tests

* solana: fix formatting

* solana: address feedback

---------

Co-authored-by: gator-boi <[email protected]>

* solana: implement relayer fees in typescript (#8)

Co-authored-by: gator-boi <[email protected]>

* solana: fix submodule commit and format ts (#9)

* solana: make anchor-build-idl

* sync submodule (branch: solana/redeemable-fast-fill)

* solana/ts: fix format and imports

* solana/ts: fix test

---------

Co-authored-by: A5 Pickle <[email protected]>

* solana: add negative tests (#12)

* solana: add negative tests for outbound usdc transfers

* solana: add more tests

---------

Co-authored-by: gator-boi <[email protected]>

* solana: add `ConsumeSwapLayerFill` composite (#11)

* solana: add `ConsumeSwapLayerFill` composite

* solana: fix Makefile

* solana: move to utils

* solana: fix complete swap; remove usdc from direct

* solana: add direct constraint

* fix submodule commit

* solana: clean up

---------

Co-authored-by: A5 Pickle <[email protected]>

* solana: add negative tests for complete transfer direct (#13)

Co-authored-by: gator-boi <[email protected]>

* SDK: Install and use Liquidity Layer SDK from packed distribution (#10)

* use packed ll packages

* fixup

* update submodule

* update submodule and sdk version (#14)

* solana: message layout + some complete swap (#15)

* solana: swap works

* solana/ts: clean up quote fetcher

* solana/ts: remove console.log

* solana/ts: fix merge conflicts

* solana: remove

---------

Co-authored-by: A5 Pickle <[email protected]>

* bump hash for submodule dep

* rm merge conflict text from src file

---------

Co-authored-by: A5 Pickle <[email protected]>
Co-authored-by: gator-boi <[email protected]>
Co-authored-by: A5 Pickle <[email protected]>
Co-authored-by: Reptile <[email protected]>
* solana: override slippage to 0

* solana: add phoenix v1 and wsol

* solana/ts: clean up

* solana: add gas handling; more clean up

---------

Co-authored-by: A5 Pickle <[email protected]>
* solana: add outbound payload support to usdc instruction

* solana: add staged transfer

* solana: add staged transfer instruction for inbound payload handling

* solana: add output token arg

* solana: add consume staged transfer ix

* solana: address feedback

* solana: add tests

* solana: address more feedback

---------

Co-authored-by: gator-boi <[email protected]>
* pin submodule to new commit

* universal/rs: fix tests

* Fix submodule TS build steps (#29)

* fix package-lock

---------

Co-authored-by: A5 Pickle <[email protected]>
Co-authored-by: Ben Guidarelli <[email protected]>
* bump versions

* fixup tests
* solana: remove

* solana: several things

* refactor

* add usdc direct handling (needs testing)

* staged outbound and initiate swap WIP

* solana: fix stage outbound; add tests

* solana: simplify staging; add is_native

* solana: add peer bump to account

* solana: fix encoded output token

* solana: add usc refund token

* solana: add initialize transfer new (untested)

* solana: fix cargo tests

* solana: add check

* fix package-lock.json

* solana: prepared order PDA; add some tests

* fix .gitmodules

* solana: yolo initialize swap exact in

* solana: add delegated amount check

* fix Makefile

* solana: fix comments

---------

Co-authored-by: A5 Pickle <[email protected]>
* bump submodule and sdk versions

* remove root dep, rebuild package-lock

* set submodule to main
* solana: add outbound USDC tests and replace initiate_transfer

* solana: address feedback

---------

Co-authored-by: gator-boi <[email protected]>
Co-authored-by: A5 Pickle <[email protected]>
* some clean-up

* solana: initiate swap works

* solana: add token interface for 2022 support

* solana: add tests; reorganize

* solana: more token interface

* solana: remove console.log

* solana: and another one

---------

Co-authored-by: A5 Pickle <[email protected]>
* universal/rs: fix Cargo.toml

* set working-directory

---------

Co-authored-by: A5 Pickle <[email protected]>
* solana: add instruction for inbound swaps with relay

* solana: add self redeem tests

---------

Co-authored-by: gator-boi <[email protected]>
* solana: fix bugs

* solana: complete swap payload

* solana: tomfoolery with staged inbound

* solana: fix comment

* solana: rename test file

* solana: priority = -1

* solana: refactor complete swap

* solana: propagate gas dropoff

* solana: fix merge conflict; reorganize

* solana: refactor again

* solana: fix clippy

* solana: as_ref

* solana: clean up

* solana: avoid needless transfer

---------

Co-authored-by: A5 Pickle <[email protected]>
* add sender

* universal/rs: remove anchor-lang

* universal/rs: reorganize

* universal/rs: payload len u32 -> u16; clean up

* solana: uptick solana-program

---------

Co-authored-by: A5 Pickle <[email protected]>
* solana: fix math operations

* solana: impl trait

---------

Co-authored-by: A5 Pickle <[email protected]>
* solana: add negative tests for swap and relay

* solana: fix relayer fee tests

* solana: add relayer fee check for exact_in

* solana: add negative tests for relay exact in

* solana: add inbound negative tests for direct

* solana: add tests for direct override swap

---------

Co-authored-by: gator-boi <[email protected]>
* solana: fix complete swap payload

* fix setting `StagedInbound::is_native`

* add more happy path tests

* solana: remove uninitialized

---------

Co-authored-by: A5 Pickle <[email protected]>
* solana: something works

* solana: blood, sweat and tears

* solana: clean up

* solana: more clean up

---------

Co-authored-by: A5 Pickle <[email protected]>
* evm: setup anvil script

* e2e: rename directory; fix run_test.sh to use anchor

* solana: make anchor-test-setup

* evm: update deployment script for e2e

* e2e: add dummy solana registrations

* e2e: read evm envs

* e2e: fix packages

* e2e: another attempt

* e2e: add function to return swap layer contract

* e2e: handle evm setup

* e2e: fix deployment and add outbound direct test

* e2e: add inbound direct test

* e2e: add solana direct test

* e2e: add relaying tests

* e2e: add gas swaps

* e2e: add gas swaps with relay (WIP)

* update makefile and package versions to fix import/resolution errors (#67)

* updates to make e2e tests use packages instead of direct access

* add foundry for solana anchor tests

* tmp

* remove package-lock from e2e dir

* update submodule version, fix import

* Remove the submodule completely instead of running its make clean target (#70)

* e2e: finish gas swap with relay tests

* e2e: add Other (Direct) swap type tests

* e2e: refactor tests

* solana: add other swap with relay

* e2e: update evm interface

* Add root make build command, improve clean targets (#71)

* e2e: update evm interface

* Add root make build command, improve clean targets

---------

Co-authored-by: gator-boi <[email protected]>

---------

Co-authored-by: gator-boi <[email protected]>
Co-authored-by: A5 Pickle <[email protected]>
Co-authored-by: Ben Guidarelli <[email protected]>
a5-pickle and others added 20 commits August 12, 2024 12:26
* fix .gitmodules

* solana: add clippy.toml

* uptick solana =1.18.15

---------

Co-authored-by: A5 Pickle <[email protected]>
* solana: add upper bound to compound

* solana: fix upper bound in test

Co-authored-by: John Saigle <[email protected]>

---------

Co-authored-by: A5 Pickle <[email protected]>
Co-authored-by: John Saigle <[email protected]>
* solana: fix prepared custody token doc

* solana: fix update fee recipient doc

---------

Co-authored-by: gator-boi <[email protected]>
* solana: remove stale comment

* solana: add additional relayer fee tests

---------

Co-authored-by: gator-boi <[email protected]>
Co-authored-by: A5 Pickle <[email protected]>
* e2e: add min amount out

* workflows: add e2e

* solana: skip Token 2022 outbound tests

NOTE: Cannot swap via Raydium CLMM now. Need to fix these tests by forking new accounts
and possibly excluding this dex.

---------

Co-authored-by: A5 Pickle <[email protected]>
* uptick rev

* solana: uptick anchor 0.30.1

* solana: fix `make lint`

---------

Co-authored-by: A5 Pickle <[email protected]>
* update submodule

* fix Makefile

e2e: update deps

evm: update deps

solana: update deps

* e2e: return anchor test exit code

* evm: fix clean

* workflows: yolo

* e2e: fix swap test

* evm: fix Makefile

* e2e: cp -r solana/target e2e

* cmon man

* workflow: make consistent

---------

Co-authored-by: A5 Pickle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants